package com.lelv.framework.tag;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ComponentTagSupport;

import com.opensymphony.xwork2.util.ValueStack;

public class DictInputTag extends ComponentTagSupport{

	private String dictField;
	private String dictKey;

	@Override
	public Component getBean(ValueStack arg0, HttpServletRequest arg1,
			HttpServletResponse arg2) {
		// TODO Auto-generated method stub
		return new DictInputComponent(arg0);
	}

	public String getDictField() {
		return dictField;
	}

	public void setDictField(String dictField) {
		this.dictField = dictField;
	}

	public String getDictKey() {
		return dictKey;
	}

	public void setDictKey(String dictKey) {
		this.dictKey = dictKey;
	}

	@Override
	protected void populateParams() {
		// TODO Auto-generated method stub
		super.populateParams();
		DictInputComponent dic = (DictInputComponent)component;
		dic.setDictKey(dictKey);
		dic.setDictField(dictField);
	}
}
